<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Kinetis Bootloader: Inter-Integrated Circuit (IIC/I2C)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Kinetis Bootloader
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
   <div id="projectbrief">Common bootloader for Kinetis devices</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Introduction</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__i2c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a>  </div>
  <div class="headertitle">
<div class="title">Inter-Integrated Circuit (IIC/I2C)</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:structi2c__master__config__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#structi2c__master__config__t">i2c_master_config_t</a></td></tr>
<tr class="memdesc:structi2c__master__config__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C master user config.  <a href="group__i2c.html#structi2c__master__config__t">More...</a><br /></td></tr>
<tr class="separator:structi2c__master__config__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structi2c__slave__config__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#structi2c__slave__config__t">i2c_slave_config_t</a></td></tr>
<tr class="memdesc:structi2c__slave__config__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C slave user config.  <a href="group__i2c.html#structi2c__slave__config__t">More...</a><br /></td></tr>
<tr class="separator:structi2c__slave__config__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structi2c__master__transfer__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#structi2c__master__transfer__t">i2c_master_transfer_t</a></td></tr>
<tr class="memdesc:structi2c__master__transfer__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C master transfer structure.  <a href="group__i2c.html#structi2c__master__transfer__t">More...</a><br /></td></tr>
<tr class="separator:structi2c__master__transfer__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:struct__i2c__master__handle"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#struct__i2c__master__handle">i2c_master_handle_t</a></td></tr>
<tr class="memdesc:struct__i2c__master__handle"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C master handle structure.  <a href="group__i2c.html#struct__i2c__master__handle">More...</a><br /></td></tr>
<tr class="separator:struct__i2c__master__handle"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structi2c__slave__transfer__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#structi2c__slave__transfer__t">i2c_slave_transfer_t</a></td></tr>
<tr class="memdesc:structi2c__slave__transfer__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C slave transfer structure.  <a href="group__i2c.html#structi2c__slave__transfer__t">More...</a><br /></td></tr>
<tr class="separator:structi2c__slave__transfer__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:struct__i2c__slave__handle"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#struct__i2c__slave__handle">i2c_slave_handle_t</a></td></tr>
<tr class="memdesc:struct__i2c__slave__handle"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C slave handle structure.  <a href="group__i2c.html#struct__i2c__slave__handle">More...</a><br /></td></tr>
<tr class="separator:struct__i2c__slave__handle"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gafa39d30cd808d79b774361874f227204"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gafa39d30cd808d79b774361874f227204"></a>
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gafa39d30cd808d79b774361874f227204">i2c_master_transfer_callback_t</a>) (I2C_Type *base, i2c_master_handle_t *handle, <a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> status, void *userData)</td></tr>
<tr class="memdesc:gafa39d30cd808d79b774361874f227204"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C master transfer callback typedef. <br /></td></tr>
<tr class="separator:gafa39d30cd808d79b774361874f227204"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2583e3d8ebf8d3de410d8b6263238c35"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga2583e3d8ebf8d3de410d8b6263238c35"></a>
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga2583e3d8ebf8d3de410d8b6263238c35">i2c_slave_transfer_callback_t</a>) (I2C_Type *base, <a class="el" href="group__i2c.html#structi2c__slave__transfer__t">i2c_slave_transfer_t</a> *xfer, void *userData)</td></tr>
<tr class="memdesc:ga2583e3d8ebf8d3de410d8b6263238c35"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C slave transfer callback typedef. <br /></td></tr>
<tr class="separator:ga2583e3d8ebf8d3de410d8b6263238c35"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga7cc91c89125c25a88e463a9e8550b284"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga7cc91c89125c25a88e463a9e8550b284">_i2c_status</a> { <br />
&#160;&#160;<a class="el" href="group__i2c.html#gga7cc91c89125c25a88e463a9e8550b284a49091894b590d7e479605bf113918952">kStatus_I2C_Busy</a> = MAKE_STATUS(kStatusGroup_I2C, 0), 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga7cc91c89125c25a88e463a9e8550b284a628d242f7bc0e3d5949c7f73eafaa508">kStatus_I2C_Idle</a> = MAKE_STATUS(kStatusGroup_I2C, 1), 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga7cc91c89125c25a88e463a9e8550b284a72fd33d0b5263a63766e62f71d16be00">kStatus_I2C_Nak</a> = MAKE_STATUS(kStatusGroup_I2C, 2), 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga7cc91c89125c25a88e463a9e8550b284a139b52cc3305ec2c06d0ac94313c221f">kStatus_I2C_ArbitrationLost</a> = MAKE_STATUS(kStatusGroup_I2C, 3), 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga7cc91c89125c25a88e463a9e8550b284a81ad7cc198436cabbe91ea55c5288747">kStatus_I2C_Timeout</a> = MAKE_STATUS(kStatusGroup_I2C, 4)
<br />
 }<tr class="memdesc:ga7cc91c89125c25a88e463a9e8550b284"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C status return codes.  <a href="group__i2c.html#ga7cc91c89125c25a88e463a9e8550b284">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:ga7cc91c89125c25a88e463a9e8550b284"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1f1337bbe9d0b184d9dcee31f9ebade2"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga1f1337bbe9d0b184d9dcee31f9ebade2">_i2c_flags</a> { <br />
&#160;&#160;<a class="el" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2a4c3c2928e17ddbfbc1c346c6b9a8dccd">kI2C_ReceiveNakFlag</a> = I2C_S_RXAK_MASK, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2a647d0b1d1f9514ad483bef3ea3926c3b">kI2C_IntPendingFlag</a> = I2C_S_IICIF_MASK, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2a249f698970909f33b1b96139c05bd969">kI2C_TransferDirectionFlag</a> = I2C_S_SRW_MASK, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2aac2c3a26d38c01fba1554eddc0c6b8b5">kI2C_RangeAddressMatchFlag</a> = I2C_S_RAM_MASK, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2a39fab5ef04e74d00ef4c4574899ab589">kI2C_ArbitrationLostFlag</a> = I2C_S_ARBL_MASK, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2a37fb20742a15a63c1bc2551b997cdcff">kI2C_BusBusyFlag</a> = I2C_S_BUSY_MASK, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2a10cd5797b1b8f809192423486a85d5fe">kI2C_AddressMatchFlag</a> = I2C_S_IAAS_MASK, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2adb8f10365dfc2a3e849f05173fa4d83e">kI2C_TransferCompleteFlag</a> = I2C_S_TCF_MASK, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2a942f41cfdfcd976ab26e77ce95c386ae">kI2C_StopDetectFlag</a> = I2C_FLT_STOPF_MASK &lt;&lt; 8, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2a07e611eaff148acca64fae7f1f0e1577">kI2C_StartDetectFlag</a> = I2C_FLT_STARTF_MASK &lt;&lt; 8
<br />
 }<tr class="memdesc:ga1f1337bbe9d0b184d9dcee31f9ebade2"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C peripheral flags.  <a href="group__i2c.html#ga1f1337bbe9d0b184d9dcee31f9ebade2">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:ga1f1337bbe9d0b184d9dcee31f9ebade2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga87c81dd985dad07dc26cb93125a94ec7"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga87c81dd985dad07dc26cb93125a94ec7">_i2c_interrupt_enable</a> { <br />
&#160;&#160;<a class="el" href="group__i2c.html#gga87c81dd985dad07dc26cb93125a94ec7a5526e27ef6e8317ba928849da890b3b2">kI2C_GlobalInterruptEnable</a> = I2C_C1_IICIE_MASK, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga87c81dd985dad07dc26cb93125a94ec7a3d36e9fb0895af1f915abdd66dd7e77c">kI2C_StopDetectInterruptEnable</a> = I2C_FLT_STOPIE_MASK, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga87c81dd985dad07dc26cb93125a94ec7a3accfbb04bdb6e48e40927efa2269390">kI2C_StartStopDetectInterruptEnable</a> = I2C_FLT_SSIE_MASK
<br />
 }<tr class="memdesc:ga87c81dd985dad07dc26cb93125a94ec7"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C feature interrupt source.  <a href="group__i2c.html#ga87c81dd985dad07dc26cb93125a94ec7">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:ga87c81dd985dad07dc26cb93125a94ec7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab49c827b45635206f06e5737606e4611"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gab49c827b45635206f06e5737606e4611">i2c_direction_t</a> { <br />
&#160;&#160;<a class="el" href="group__i2c.html#ggab49c827b45635206f06e5737606e4611a93b476b469c2a4bfed5916b458ae9bb0">kI2C_Write</a> = 0x0U, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#ggab49c827b45635206f06e5737606e4611a3a7bb24dc8d1c1be8925603eeafe9b30">kI2C_Read</a> = 0x1U
<br />
 }<tr class="memdesc:gab49c827b45635206f06e5737606e4611"><td class="mdescLeft">&#160;</td><td class="mdescRight">Direction of master and slave transfers.  <a href="group__i2c.html#gab49c827b45635206f06e5737606e4611">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:gab49c827b45635206f06e5737606e4611"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac21e18657981bd7861f2ac5ebc5f633b"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gac21e18657981bd7861f2ac5ebc5f633b">i2c_slave_address_mode_t</a> { <br />
&#160;&#160;<a class="el" href="group__i2c.html#ggac21e18657981bd7861f2ac5ebc5f633ba3e2c7f1f917939d0d7595224e3700dd4">kI2C_Address7bit</a> = 0x0U, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#ggac21e18657981bd7861f2ac5ebc5f633baa2c312f87691c542c466ff747d21f70a">kI2C_RangeMatch</a> = 0X2U
<br />
 }<tr class="memdesc:gac21e18657981bd7861f2ac5ebc5f633b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Addressing mode.  <a href="group__i2c.html#gac21e18657981bd7861f2ac5ebc5f633b">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:gac21e18657981bd7861f2ac5ebc5f633b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga87ea07668194cfb46c7c368d2cb42433"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga87ea07668194cfb46c7c368d2cb42433">_i2c_master_transfer_flags</a> { <br />
&#160;&#160;<a class="el" href="group__i2c.html#gga87ea07668194cfb46c7c368d2cb42433ae80f7b768b1621e42ac965d3d23de5e2">kI2C_TransferDefaultFlag</a> = 0x0U, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga87ea07668194cfb46c7c368d2cb42433a5cb44bf860c0482c0ca0165cf0d31d8a">kI2C_TransferNoStartFlag</a> = 0x1U, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga87ea07668194cfb46c7c368d2cb42433aadf112471ef12f194985a093cd9b9721">kI2C_TransferRepeatedStartFlag</a> = 0x2U, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#gga87ea07668194cfb46c7c368d2cb42433afb8aeea71b5b7475e3d3df86220db566">kI2C_TransferNoStopFlag</a> = 0x4U
<br />
 }<tr class="memdesc:ga87ea07668194cfb46c7c368d2cb42433"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C transfer control flag.  <a href="group__i2c.html#ga87ea07668194cfb46c7c368d2cb42433">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:ga87ea07668194cfb46c7c368d2cb42433"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac53e5c96a2eed1b5a95b7d84be48f4ac"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gac53e5c96a2eed1b5a95b7d84be48f4ac">i2c_slave_transfer_event_t</a> { <br />
&#160;&#160;<a class="el" href="group__i2c.html#ggac53e5c96a2eed1b5a95b7d84be48f4acacb1ae174dd6798a6fd79800a9e39a3c6">kI2C_SlaveAddressMatchEvent</a> = 0x01U, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#ggac53e5c96a2eed1b5a95b7d84be48f4aca2f85039a57379838909876a1d509b7aa">kI2C_SlaveTransmitEvent</a> = 0x02U, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#ggac53e5c96a2eed1b5a95b7d84be48f4acaac8593e808a8137d1b5d3a51640779de">kI2C_SlaveReceiveEvent</a> = 0x04U, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#ggac53e5c96a2eed1b5a95b7d84be48f4aca43c045da27fa60e7a0540c743eca4e79">kI2C_SlaveTransmitAckEvent</a> = 0x08U, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#ggac53e5c96a2eed1b5a95b7d84be48f4aca4c7de9b9d0c71a86ef6bd5cd6a39dad5">kI2C_SlaveRepeatedStartEvent</a> = 0x10U, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#ggac53e5c96a2eed1b5a95b7d84be48f4aca38cca3cd668e73f51b8e574835d419df">kI2C_SlaveCompletionEvent</a> = 0x20U, 
<br />
&#160;&#160;<a class="el" href="group__i2c.html#ggac53e5c96a2eed1b5a95b7d84be48f4aca94b030ebdac378a84961893ae567bfbc">kI2C_SlaveAllEvents</a>
<br />
 }<tr class="memdesc:gac53e5c96a2eed1b5a95b7d84be48f4ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set of events sent to the callback for nonblocking slave transfers.  <a href="group__i2c.html#gac53e5c96a2eed1b5a95b7d84be48f4ac">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:gac53e5c96a2eed1b5a95b7d84be48f4ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
Initialization and deinitialization</h2></td></tr>
<tr class="memitem:ga29f967b3ae8487a36ba2a58deb01ccae"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga29f967b3ae8487a36ba2a58deb01ccae">I2C_MasterInit</a> (I2C_Type *base, const <a class="el" href="group__i2c.html#structi2c__master__config__t">i2c_master_config_t</a> *masterConfig, uint32_t srcClock_Hz)</td></tr>
<tr class="memdesc:ga29f967b3ae8487a36ba2a58deb01ccae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the I2C peripheral, call this API to ungate the i2c clock and configure the I2C with master configuration.  <a href="#ga29f967b3ae8487a36ba2a58deb01ccae">More...</a><br /></td></tr>
<tr class="separator:ga29f967b3ae8487a36ba2a58deb01ccae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae6e155a5aadb43d527418e2965e39123"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gae6e155a5aadb43d527418e2965e39123">I2C_SlaveInit</a> (I2C_Type *base, const <a class="el" href="group__i2c.html#structi2c__slave__config__t">i2c_slave_config_t</a> *slaveConfig)</td></tr>
<tr class="memdesc:gae6e155a5aadb43d527418e2965e39123"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the I2C peripheral, call this API to ungate the i2c clock and initializes the I2C with slave configuration.  <a href="#gae6e155a5aadb43d527418e2965e39123">More...</a><br /></td></tr>
<tr class="separator:gae6e155a5aadb43d527418e2965e39123"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadcf7122f0a38d4d9da0f052fcb167957"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gadcf7122f0a38d4d9da0f052fcb167957">I2C_MasterDeinit</a> (I2C_Type *base)</td></tr>
<tr class="memdesc:gadcf7122f0a38d4d9da0f052fcb167957"><td class="mdescLeft">&#160;</td><td class="mdescRight">De-initialize the I2C master peripheral, call thi API will gate the i2c clock, so the I2C master module can not work unless call I2C_MasterInit.  <a href="#gadcf7122f0a38d4d9da0f052fcb167957">More...</a><br /></td></tr>
<tr class="separator:gadcf7122f0a38d4d9da0f052fcb167957"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadb50014db29dd75ea2001fb7bc837e77"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gadb50014db29dd75ea2001fb7bc837e77">I2C_SlaveDeinit</a> (I2C_Type *base)</td></tr>
<tr class="memdesc:gadb50014db29dd75ea2001fb7bc837e77"><td class="mdescLeft">&#160;</td><td class="mdescRight">De-initialize the I2C slave peripheral, call thi API will gate the i2c clock, so the I2C slave module can not work unless call I2C_SlaveInit to enable the clock.  <a href="#gadb50014db29dd75ea2001fb7bc837e77">More...</a><br /></td></tr>
<tr class="separator:gadb50014db29dd75ea2001fb7bc837e77"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad69f2d63ea756dda60749ff6b09f587d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gad69f2d63ea756dda60749ff6b09f587d">I2C_MasterGetDefaultConfig</a> (<a class="el" href="group__i2c.html#structi2c__master__config__t">i2c_master_config_t</a> *masterConfig)</td></tr>
<tr class="memdesc:gad69f2d63ea756dda60749ff6b09f587d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the I2C master configuration structure to default values.  <a href="#gad69f2d63ea756dda60749ff6b09f587d">More...</a><br /></td></tr>
<tr class="separator:gad69f2d63ea756dda60749ff6b09f587d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7115f80e28b62bbbd3be1a2a918529ba"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga7115f80e28b62bbbd3be1a2a918529ba">I2C_SlaveGetDefaultConfig</a> (<a class="el" href="group__i2c.html#structi2c__slave__config__t">i2c_slave_config_t</a> *slaveConfig)</td></tr>
<tr class="memdesc:ga7115f80e28b62bbbd3be1a2a918529ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the I2C slave configuration structure to default values.  <a href="#ga7115f80e28b62bbbd3be1a2a918529ba">More...</a><br /></td></tr>
<tr class="separator:ga7115f80e28b62bbbd3be1a2a918529ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaaaab1e83cb8c6117046bdb5bcbf9ac6"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gaaaaab1e83cb8c6117046bdb5bcbf9ac6">I2C_Enable</a> (I2C_Type *base, bool enable)</td></tr>
<tr class="memdesc:gaaaaab1e83cb8c6117046bdb5bcbf9ac6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable or disables the I2C peripheral operation.  <a href="#gaaaaab1e83cb8c6117046bdb5bcbf9ac6">More...</a><br /></td></tr>
<tr class="separator:gaaaaab1e83cb8c6117046bdb5bcbf9ac6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
Status</h2></td></tr>
<tr class="memitem:ga721e41295dedc83b424e80e53065e625"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga721e41295dedc83b424e80e53065e625">I2C_MasterGetStatusFlags</a> (I2C_Type *base)</td></tr>
<tr class="memdesc:ga721e41295dedc83b424e80e53065e625"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the I2C status flags.  <a href="#ga721e41295dedc83b424e80e53065e625">More...</a><br /></td></tr>
<tr class="separator:ga721e41295dedc83b424e80e53065e625"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac2794e138d94d9b6a761c074ad0899cd"><td class="memItemLeft" align="right" valign="top">static uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gac2794e138d94d9b6a761c074ad0899cd">I2C_SlaveGetStatusFlags</a> (I2C_Type *base)</td></tr>
<tr class="memdesc:gac2794e138d94d9b6a761c074ad0899cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the I2C status flags.  <a href="#gac2794e138d94d9b6a761c074ad0899cd">More...</a><br /></td></tr>
<tr class="separator:gac2794e138d94d9b6a761c074ad0899cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga437271ffb955b77df0a5dee9ea80cc63"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga437271ffb955b77df0a5dee9ea80cc63">I2C_MasterClearStatusFlags</a> (I2C_Type *base, uint32_t statusMask)</td></tr>
<tr class="memdesc:ga437271ffb955b77df0a5dee9ea80cc63"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears the I2C status flag state.  <a href="#ga437271ffb955b77df0a5dee9ea80cc63">More...</a><br /></td></tr>
<tr class="separator:ga437271ffb955b77df0a5dee9ea80cc63"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga545c1a43d8d49c4675de493d45a4063a"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga545c1a43d8d49c4675de493d45a4063a">I2C_SlaveClearStatusFlags</a> (I2C_Type *base, uint32_t statusMask)</td></tr>
<tr class="memdesc:ga545c1a43d8d49c4675de493d45a4063a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears the I2C status flag state.  <a href="#ga545c1a43d8d49c4675de493d45a4063a">More...</a><br /></td></tr>
<tr class="separator:ga545c1a43d8d49c4675de493d45a4063a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
Interrupts</h2></td></tr>
<tr class="memitem:ga577e094cc4d39b88ec5bbe49bc199c77"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga577e094cc4d39b88ec5bbe49bc199c77">I2C_EnableInterrupts</a> (I2C_Type *base, uint32_t mask)</td></tr>
<tr class="memdesc:ga577e094cc4d39b88ec5bbe49bc199c77"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable I2C interrupt requests.  <a href="#ga577e094cc4d39b88ec5bbe49bc199c77">More...</a><br /></td></tr>
<tr class="separator:ga577e094cc4d39b88ec5bbe49bc199c77"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9839c1fd49a0f62f42b0adfa74f62853"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga9839c1fd49a0f62f42b0adfa74f62853">I2C_DisableInterrupts</a> (I2C_Type *base, uint32_t mask)</td></tr>
<tr class="memdesc:ga9839c1fd49a0f62f42b0adfa74f62853"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disable I2C interrupt requests.  <a href="#ga9839c1fd49a0f62f42b0adfa74f62853">More...</a><br /></td></tr>
<tr class="separator:ga9839c1fd49a0f62f42b0adfa74f62853"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
DMA Control</h2></td></tr>
<tr class="memitem:gac1c7c015a74aa0e2c8cd7df6dbf7fb71"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gac1c7c015a74aa0e2c8cd7df6dbf7fb71">I2C_EnableDMA</a> (I2C_Type *base, bool enable)</td></tr>
<tr class="memdesc:gac1c7c015a74aa0e2c8cd7df6dbf7fb71"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables/disables the I2C DMA interrupt.  <a href="#gac1c7c015a74aa0e2c8cd7df6dbf7fb71">More...</a><br /></td></tr>
<tr class="separator:gac1c7c015a74aa0e2c8cd7df6dbf7fb71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf3238d6c3de8e7e8aa7a6c3a8d645769"><td class="memItemLeft" align="right" valign="top">static uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gaf3238d6c3de8e7e8aa7a6c3a8d645769">I2C_GetDataRegAddr</a> (I2C_Type *base)</td></tr>
<tr class="memdesc:gaf3238d6c3de8e7e8aa7a6c3a8d645769"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get I2C tx/rx data register address This API is used to provide transfer address for I2C DMA transfer configuration.  <a href="#gaf3238d6c3de8e7e8aa7a6c3a8d645769">More...</a><br /></td></tr>
<tr class="separator:gaf3238d6c3de8e7e8aa7a6c3a8d645769"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
Bus Operations</h2></td></tr>
<tr class="memitem:gafeab1d5249a8b39c8d9e1a54a85c23f0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gafeab1d5249a8b39c8d9e1a54a85c23f0">I2C_MasterSetBaudRate</a> (I2C_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz)</td></tr>
<tr class="memdesc:gafeab1d5249a8b39c8d9e1a54a85c23f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the I2C master transfer baudrate.  <a href="#gafeab1d5249a8b39c8d9e1a54a85c23f0">More...</a><br /></td></tr>
<tr class="separator:gafeab1d5249a8b39c8d9e1a54a85c23f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7664234966e4162e952b6d57efcaa8a6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga7664234966e4162e952b6d57efcaa8a6">I2C_MasterStart</a> (I2C_Type *base, uint8_t address, <a class="el" href="group__i2c.html#gab49c827b45635206f06e5737606e4611">i2c_direction_t</a> direction)</td></tr>
<tr class="memdesc:ga7664234966e4162e952b6d57efcaa8a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends a START on the I2C bus.  <a href="#ga7664234966e4162e952b6d57efcaa8a6">More...</a><br /></td></tr>
<tr class="separator:ga7664234966e4162e952b6d57efcaa8a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf46a8cc094fc18c6cadea8de71448723"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gaf46a8cc094fc18c6cadea8de71448723">I2C_MasterStop</a> (I2C_Type *base)</td></tr>
<tr class="memdesc:gaf46a8cc094fc18c6cadea8de71448723"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends a STOP signal on the I2C bus.  <a href="#gaf46a8cc094fc18c6cadea8de71448723">More...</a><br /></td></tr>
<tr class="separator:gaf46a8cc094fc18c6cadea8de71448723"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga42ff265d25e713326c7d152adf350147"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga42ff265d25e713326c7d152adf350147">I2C_MasterRepeatedStart</a> (I2C_Type *base, uint8_t address, <a class="el" href="group__i2c.html#gab49c827b45635206f06e5737606e4611">i2c_direction_t</a> direction)</td></tr>
<tr class="memdesc:ga42ff265d25e713326c7d152adf350147"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends a REPEATED START on the I2C bus.  <a href="#ga42ff265d25e713326c7d152adf350147">More...</a><br /></td></tr>
<tr class="separator:ga42ff265d25e713326c7d152adf350147"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaba0a9e727e5a141b59b67f10a24dc9e6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gaba0a9e727e5a141b59b67f10a24dc9e6">I2C_MasterWriteBlocking</a> (I2C_Type *base, const uint8_t *txBuff, size_t txSize)</td></tr>
<tr class="memdesc:gaba0a9e727e5a141b59b67f10a24dc9e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs a polling send transaction on the I2C bus without a STOP signal.  <a href="#gaba0a9e727e5a141b59b67f10a24dc9e6">More...</a><br /></td></tr>
<tr class="separator:gaba0a9e727e5a141b59b67f10a24dc9e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga815e953753bbfeea5277b527b16ac23e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga815e953753bbfeea5277b527b16ac23e">I2C_MasterReadBlocking</a> (I2C_Type *base, uint8_t *rxBuff, size_t rxSize)</td></tr>
<tr class="memdesc:ga815e953753bbfeea5277b527b16ac23e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs a polling receive transaction on the I2C bus with a STOP signal.  <a href="#ga815e953753bbfeea5277b527b16ac23e">More...</a><br /></td></tr>
<tr class="separator:ga815e953753bbfeea5277b527b16ac23e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga280404c6b1ede542f2c1c20bd382869c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga280404c6b1ede542f2c1c20bd382869c">I2C_SlaveWriteBlocking</a> (I2C_Type *base, const uint8_t *txBuff, size_t txSize)</td></tr>
<tr class="memdesc:ga280404c6b1ede542f2c1c20bd382869c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs a polling send transaction on the I2C bus.  <a href="#ga280404c6b1ede542f2c1c20bd382869c">More...</a><br /></td></tr>
<tr class="separator:ga280404c6b1ede542f2c1c20bd382869c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf7409e50ffd9b260744c13863c7a3987"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gaf7409e50ffd9b260744c13863c7a3987">I2C_SlaveReadBlocking</a> (I2C_Type *base, uint8_t *rxBuff, size_t rxSize)</td></tr>
<tr class="memdesc:gaf7409e50ffd9b260744c13863c7a3987"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs a polling receive transaction on the I2C bus.  <a href="#gaf7409e50ffd9b260744c13863c7a3987">More...</a><br /></td></tr>
<tr class="separator:gaf7409e50ffd9b260744c13863c7a3987"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga35cae3a5b4aa50ce8db28e3eb703a027"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga35cae3a5b4aa50ce8db28e3eb703a027">I2C_MasterTransferBlocking</a> (I2C_Type *base, <a class="el" href="group__i2c.html#structi2c__master__transfer__t">i2c_master_transfer_t</a> *xfer)</td></tr>
<tr class="memdesc:ga35cae3a5b4aa50ce8db28e3eb703a027"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs a master polling transfer on the I2C bus.  <a href="#ga35cae3a5b4aa50ce8db28e3eb703a027">More...</a><br /></td></tr>
<tr class="separator:ga35cae3a5b4aa50ce8db28e3eb703a027"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
Transactional</h2></td></tr>
<tr class="memitem:ga31e3de02b57801c6896e6045c4a31268"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga31e3de02b57801c6896e6045c4a31268">I2C_MasterTransferCreateHandle</a> (I2C_Type *base, i2c_master_handle_t *handle, <a class="el" href="group__i2c.html#gafa39d30cd808d79b774361874f227204">i2c_master_transfer_callback_t</a> callback, void *userData)</td></tr>
<tr class="memdesc:ga31e3de02b57801c6896e6045c4a31268"><td class="mdescLeft">&#160;</td><td class="mdescRight">Init the I2C handle which is used in transactional functions.  <a href="#ga31e3de02b57801c6896e6045c4a31268">More...</a><br /></td></tr>
<tr class="separator:ga31e3de02b57801c6896e6045c4a31268"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac7f76a04b6f6873c52ad176d58901fe9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gac7f76a04b6f6873c52ad176d58901fe9">I2C_MasterTransferNonBlocking</a> (I2C_Type *base, i2c_master_handle_t *handle, <a class="el" href="group__i2c.html#structi2c__master__transfer__t">i2c_master_transfer_t</a> *xfer)</td></tr>
<tr class="memdesc:gac7f76a04b6f6873c52ad176d58901fe9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs a master interrupt non-blocking transfer on the I2C bus.  <a href="#gac7f76a04b6f6873c52ad176d58901fe9">More...</a><br /></td></tr>
<tr class="separator:gac7f76a04b6f6873c52ad176d58901fe9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7d720842e68161d2d52d56d119f20665"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga7d720842e68161d2d52d56d119f20665">I2C_MasterTransferGetCount</a> (I2C_Type *base, i2c_master_handle_t *handle, size_t *count)</td></tr>
<tr class="memdesc:ga7d720842e68161d2d52d56d119f20665"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get master transfer status during a interrupt non-blocking transfer.  <a href="#ga7d720842e68161d2d52d56d119f20665">More...</a><br /></td></tr>
<tr class="separator:ga7d720842e68161d2d52d56d119f20665"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga77c9f9c8bc0fe71bbcd9d479f51f8044"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga77c9f9c8bc0fe71bbcd9d479f51f8044">I2C_MasterTransferAbort</a> (I2C_Type *base, i2c_master_handle_t *handle)</td></tr>
<tr class="memdesc:ga77c9f9c8bc0fe71bbcd9d479f51f8044"><td class="mdescLeft">&#160;</td><td class="mdescRight">Abort a interrupt non-blocking transfer in a early time.  <a href="#ga77c9f9c8bc0fe71bbcd9d479f51f8044">More...</a><br /></td></tr>
<tr class="separator:ga77c9f9c8bc0fe71bbcd9d479f51f8044"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad091cd1857d2bd8ce64583739b3a35d5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gad091cd1857d2bd8ce64583739b3a35d5">I2C_MasterTransferHandleIRQ</a> (I2C_Type *base, void *i2cHandle)</td></tr>
<tr class="memdesc:gad091cd1857d2bd8ce64583739b3a35d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Master interrupt handler.  <a href="#gad091cd1857d2bd8ce64583739b3a35d5">More...</a><br /></td></tr>
<tr class="separator:gad091cd1857d2bd8ce64583739b3a35d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac9b90f575d92ff8ad3cc350a5c8ad1b9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gac9b90f575d92ff8ad3cc350a5c8ad1b9">I2C_SlaveTransferCreateHandle</a> (I2C_Type *base, i2c_slave_handle_t *handle, <a class="el" href="group__i2c.html#ga2583e3d8ebf8d3de410d8b6263238c35">i2c_slave_transfer_callback_t</a> callback, void *userData)</td></tr>
<tr class="memdesc:gac9b90f575d92ff8ad3cc350a5c8ad1b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Init the I2C handle which is used in transcational functions.  <a href="#gac9b90f575d92ff8ad3cc350a5c8ad1b9">More...</a><br /></td></tr>
<tr class="separator:gac9b90f575d92ff8ad3cc350a5c8ad1b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa387d81ea08a9d4b39cfeb3dfec505f7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gaa387d81ea08a9d4b39cfeb3dfec505f7">I2C_SlaveTransferNonBlocking</a> (I2C_Type *base, i2c_slave_handle_t *handle, uint32_t eventMask)</td></tr>
<tr class="memdesc:gaa387d81ea08a9d4b39cfeb3dfec505f7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start accepting slave transfers.  <a href="#gaa387d81ea08a9d4b39cfeb3dfec505f7">More...</a><br /></td></tr>
<tr class="separator:gaa387d81ea08a9d4b39cfeb3dfec505f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5ae9f5e6e854d14d33ba3029128bd6f0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga5ae9f5e6e854d14d33ba3029128bd6f0">I2C_SlaveTransferAbort</a> (I2C_Type *base, i2c_slave_handle_t *handle)</td></tr>
<tr class="memdesc:ga5ae9f5e6e854d14d33ba3029128bd6f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Abort slave transfer.  <a href="#ga5ae9f5e6e854d14d33ba3029128bd6f0">More...</a><br /></td></tr>
<tr class="separator:ga5ae9f5e6e854d14d33ba3029128bd6f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabf38a498bd3527ea0b7cc947ae71e17e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#gabf38a498bd3527ea0b7cc947ae71e17e">I2C_SlaveTransferGetCount</a> (I2C_Type *base, i2c_slave_handle_t *handle, size_t *count)</td></tr>
<tr class="memdesc:gabf38a498bd3527ea0b7cc947ae71e17e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get slave transfer remaining bytes during a interrupt non-blocking transfer.  <a href="#gabf38a498bd3527ea0b7cc947ae71e17e">More...</a><br /></td></tr>
<tr class="separator:gabf38a498bd3527ea0b7cc947ae71e17e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga097c0b20503381de44cccba311dcf236"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__i2c.html#ga097c0b20503381de44cccba311dcf236">I2C_SlaveTransferHandleIRQ</a> (I2C_Type *base, void *i2cHandle)</td></tr>
<tr class="memdesc:ga097c0b20503381de44cccba311dcf236"><td class="mdescLeft">&#160;</td><td class="mdescRight">Slave interrupt handler.  <a href="#ga097c0b20503381de44cccba311dcf236">More...</a><br /></td></tr>
<tr class="separator:ga097c0b20503381de44cccba311dcf236"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Usage Information</h2>
<p>The KSDK provides a peripheral driver for the Inter-Integrated Circuit (I2C) module of Kinetis devices.</p>
<h1><a class="anchor" id="I2COvw"></a>
Overview</h1>
<p>The I2C driver includes functional APIs and transactional APIs.</p>
<p>Functional APIs are feature/property target low level APIs. Functional APIs can be used for the I2C master/slave initialization/configuration/operation for optimization/customization purpose. Using the functional APIs requires the knowledge of the I2C master peripheral and how to organize functional APIs to meet the application requirements. The I2C functional operation groups provide the functional APIs set.</p>
<p>Transactional APIs are transaction target high level APIs. The transactional APIs can be used to enable the peripheral quickly and also in the application if the code size and performance of transactional APIs satisfy the requirements. If the code size and performance are critical requirements, see the transactional API implementation and write custom code using the functional APIs or accessing the hardware registers.</p>
<p>Transactional APIs support asynchronous transfer. This means that the functions <a class="el" href="group__i2c.html#gac7f76a04b6f6873c52ad176d58901fe9" title="Performs a master interrupt non-blocking transfer on the I2C bus. ">I2C_MasterTransferNonBlocking()</a> set up the interrupt non-blocking transfer. When the transfer completes, the upper layer is notified through a callback function with the status.</p>
<h1><a class="anchor" id="I2CFunGrps"></a>
Function groups</h1>
<h2><a class="anchor" id="I2CInit"></a>
Initialization and deinitialization</h2>
<p>The function <a class="el" href="group__i2c.html#ga29f967b3ae8487a36ba2a58deb01ccae" title="Initialize the I2C peripheral, call this API to ungate the i2c clock and configure the I2C with maste...">I2C_MasterInit()</a>/I2C_SlaveInit() initializes the I2C master/slave with a specified configurations. The function <a class="el" href="group__i2c.html#gad69f2d63ea756dda60749ff6b09f587d" title="Set the I2C master configuration structure to default values. ">I2C_MasterGetDefaultConfig()</a>/I2C_SlaveGetDefaultConfig() gets the default configurations.</p>
<h2><a class="anchor" id="I2CStatus"></a>
Status</h2>
<p>Provides functions to get and clear the I2C master/slave status.</p>
<h2><a class="anchor" id="I2CInterrupt"></a>
Interrupt</h2>
<p>Provides functions to enable/disable I2C interrupts.</p>
<h2><a class="anchor" id="I2CDmaCtrl"></a>
DMA Control</h2>
<p>Provides functions for I2C to enable/disable generate the DMA request.</p>
<h2><a class="anchor" id="I2COperation"></a>
Bus Operations</h2>
<p>Provides functions to generate bus control signals, start/re-start/stop, write/read data. Additionally, provides functions to set baud rate.</p>
<h2><a class="anchor" id="I2CTrans"></a>
Transactional</h2>
<p>Provides functions to transfer data through interrupt or dma.</p>
<h1><a class="anchor" id="I2CTpyUC"></a>
Typical use case</h1>
<h2><a class="anchor" id="I2CMasterOpsFunctional"></a>
Master Operation in functional method</h2>
<div class="fragment"><div class="line"><a class="code" href="group__i2c.html#structi2c__master__config__t">i2c_master_config_t</a> masterConfig;</div><div class="line">uint8_t status;</div><div class="line"><a class="code" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> result = kStatus_Success;</div><div class="line">uint8_t txBuff[BUFFER_SIZE];</div><div class="line"></div><div class="line"><span class="comment">/* Get default configuration for master. */</span></div><div class="line"><a class="code" href="group__i2c.html#gad69f2d63ea756dda60749ff6b09f587d">I2C_MasterGetDefaultConfig</a>(&amp;masterConfig);</div><div class="line"></div><div class="line"><span class="comment">/* Init I2C master. */</span></div><div class="line"><a class="code" href="group__i2c.html#ga29f967b3ae8487a36ba2a58deb01ccae">I2C_MasterInit</a>(EXAMPLE_I2C_MASTER_BASEADDR, &amp;masterConfig, I2C_MASTER_CLK);</div><div class="line"></div><div class="line"><span class="comment">/* Send start and slave address. */</span></div><div class="line"><a class="code" href="group__i2c.html#ga7664234966e4162e952b6d57efcaa8a6">I2C_MasterStart</a>(EXAMPLE_I2C_MASTER_BASEADDR, 7-bit slave address, <a class="code" href="group__i2c.html#ggab49c827b45635206f06e5737606e4611a93b476b469c2a4bfed5916b458ae9bb0">kI2C_Write</a>/<a class="code" href="group__i2c.html#ggab49c827b45635206f06e5737606e4611a3a7bb24dc8d1c1be8925603eeafe9b30">kI2C_Read</a>);</div><div class="line"></div><div class="line"><span class="comment">/* Wait address sent out. */</span></div><div class="line"><span class="keywordflow">while</span>(!((status = I2C_GetStatusFlag(EXAMPLE_I2C_MASTER_BASEADDR)) &amp; <a class="code" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2a647d0b1d1f9514ad483bef3ea3926c3b">kI2C_IntPendingFlag</a>))</div><div class="line">{</div><div class="line"></div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordflow">if</span>(status &amp; <a class="code" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2a4c3c2928e17ddbfbc1c346c6b9a8dccd">kI2C_ReceiveNakFlag</a>)</div><div class="line">{</div><div class="line">    <span class="keywordflow">return</span> <a class="code" href="group__i2c.html#gga7cc91c89125c25a88e463a9e8550b284a72fd33d0b5263a63766e62f71d16be00">kStatus_I2C_Nak</a>;</div><div class="line">}</div><div class="line"></div><div class="line">result = <a class="code" href="group__i2c.html#gaba0a9e727e5a141b59b67f10a24dc9e6">I2C_MasterWriteBlocking</a>(EXAMPLE_I2C_MASTER_BASEADDR, txBuff, BUFFER_SIZE);</div><div class="line"></div><div class="line"><span class="keywordflow">if</span>(result)</div><div class="line">{</div><div class="line">    <span class="comment">/* If error occours, send STOP. */</span></div><div class="line">    <a class="code" href="group__i2c.html#gaf46a8cc094fc18c6cadea8de71448723">I2C_MasterStop</a>(EXAMPLE_I2C_MASTER_BASEADDR, kI2CStop);</div><div class="line">    <span class="keywordflow">return</span> result;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordflow">while</span>(!(I2C_GetStatusFlag(EXAMPLE_I2C_MASTER_BASEADDR) &amp; kI2C_IntPendingFlag))</div><div class="line">{</div><div class="line"></div><div class="line">}</div><div class="line"></div><div class="line"><span class="comment">/* Wait all data sent out, send STOP. */</span></div><div class="line"><a class="code" href="group__i2c.html#gaf46a8cc094fc18c6cadea8de71448723">I2C_MasterStop</a>(EXAMPLE_I2C_MASTER_BASEADDR, kI2CStop);</div></div><!-- fragment --><h2><a class="anchor" id="I2CMasterOpsTransIRQ"></a>
Master Operation in interrupt transactional method</h2>
<div class="fragment"><div class="line">i2c_master_handle_t g_m_handle;</div><div class="line"><span class="keyword">volatile</span> <span class="keywordtype">bool</span> g_MasterCompletionFlag = <span class="keyword">false</span>;</div><div class="line"><a class="code" href="group__i2c.html#structi2c__master__config__t">i2c_master_config_t</a> masterConfig;</div><div class="line">uint8_t status;</div><div class="line"><a class="code" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> result = kStatus_Success;</div><div class="line">uint8_t txBuff[BUFFER_SIZE];</div><div class="line"><a class="code" href="group__i2c.html#structi2c__master__transfer__t">i2c_master_transfer_t</a> masterXfer;</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> i2c_master_callback(I2C_Type *base, i2c_master_handle_t *handle, <a class="code" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> status, <span class="keywordtype">void</span> *userData)</div><div class="line">{</div><div class="line">    <span class="comment">/* Signal transfer success when received success status. */</span></div><div class="line">    <span class="keywordflow">if</span> (status == kStatus_Success)</div><div class="line">    {</div><div class="line">        g_MasterCompletionFlag = <span class="keyword">true</span>;</div><div class="line">    }</div><div class="line">}</div><div class="line"></div><div class="line"><span class="comment">/* Get default configuration for master. */</span></div><div class="line"><a class="code" href="group__i2c.html#gad69f2d63ea756dda60749ff6b09f587d">I2C_MasterGetDefaultConfig</a>(&amp;masterConfig);</div><div class="line"></div><div class="line"><span class="comment">/* Init I2C master. */</span></div><div class="line"><a class="code" href="group__i2c.html#ga29f967b3ae8487a36ba2a58deb01ccae">I2C_MasterInit</a>(EXAMPLE_I2C_MASTER_BASEADDR, &amp;masterConfig, I2C_MASTER_CLK);</div><div class="line"></div><div class="line">masterXfer.<a class="code" href="group__i2c.html#a7b9ab02d5063e8653f0586395ccd7013">slaveAddress</a> = I2C_MASTER_SLAVE_ADDR_7BIT;</div><div class="line">masterXfer.<a class="code" href="group__i2c.html#aec93fd70f8f4f4cf2fafcbe0a4df08c2">direction</a> = <a class="code" href="group__i2c.html#ggab49c827b45635206f06e5737606e4611a93b476b469c2a4bfed5916b458ae9bb0">kI2C_Write</a>;</div><div class="line">masterXfer.<a class="code" href="group__i2c.html#a6fbfb5e5018422a177a9f3ed7269b127">subaddress</a> = NULL;</div><div class="line">masterXfer.<a class="code" href="group__i2c.html#ab690ec66e8cde484f919799fb1118cd6">subaddressSize</a> = 0;</div><div class="line">masterXfer.<a class="code" href="group__i2c.html#a6df23c71c49ca7371f41136934d4fad1">data</a> = txBuff;</div><div class="line">masterXfer.<a class="code" href="group__i2c.html#aec81567ca73e5b0cb790098785e345c5">dataSize</a> = BUFFER_SIZE;</div><div class="line">masterXfer.<a class="code" href="group__i2c.html#a773b39d480759f67926cb18ae2219281">flags</a> = <a class="code" href="group__i2c.html#gga87ea07668194cfb46c7c368d2cb42433ae80f7b768b1621e42ac965d3d23de5e2">kI2C_TransferDefaultFlag</a>;</div><div class="line"></div><div class="line"><a class="code" href="group__i2c.html#ga31e3de02b57801c6896e6045c4a31268">I2C_MasterTransferCreateHandle</a>(EXAMPLE_I2C_MASTER_BASEADDR, &amp;g_m_handle, i2c_master_callback, NULL);</div><div class="line"><a class="code" href="group__i2c.html#gac7f76a04b6f6873c52ad176d58901fe9">I2C_MasterTransferNonBlocking</a>(EXAMPLE_I2C_MASTER_BASEADDR, &amp;g_m_handle, &amp;masterXfer);</div><div class="line"></div><div class="line"><span class="comment">/*  Wait for transfer completed. */</span></div><div class="line"><span class="keywordflow">while</span> (!g_MasterCompletionFlag)</div><div class="line">{</div><div class="line">}</div><div class="line">g_MasterCompletionFlag = <span class="keyword">false</span>;</div></div><!-- fragment --><h2><a class="anchor" id="I2CMasterOpsTransDMA"></a>
Master Operation in DMA transactional method</h2>
<div class="fragment"><div class="line">i2c_master_dma_handle_t g_m_dma_handle;</div><div class="line">dma_handle_t dmaHandle;</div><div class="line"><span class="keyword">volatile</span> <span class="keywordtype">bool</span> g_MasterCompletionFlag = <span class="keyword">false</span>;</div><div class="line"><a class="code" href="group__i2c.html#structi2c__master__config__t">i2c_master_config_t</a> masterConfig;</div><div class="line">uint8_t txBuff[BUFFER_SIZE];</div><div class="line"><a class="code" href="group__i2c.html#structi2c__master__transfer__t">i2c_master_transfer_t</a> masterXfer;</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> i2c_master_callback(I2C_Type *base, i2c_master_dma_handle_t *handle, <a class="code" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> status, <span class="keywordtype">void</span> *userData)</div><div class="line">{</div><div class="line">    <span class="comment">/* Signal transfer success when received success status. */</span></div><div class="line">    <span class="keywordflow">if</span> (status == kStatus_Success)</div><div class="line">    {</div><div class="line">        g_MasterCompletionFlag = <span class="keyword">true</span>;</div><div class="line">    }</div><div class="line">}</div><div class="line"></div><div class="line"><span class="comment">/* Get default configuration for master. */</span></div><div class="line"><a class="code" href="group__i2c.html#gad69f2d63ea756dda60749ff6b09f587d">I2C_MasterGetDefaultConfig</a>(&amp;masterConfig);</div><div class="line"></div><div class="line"><span class="comment">/* Init I2C master. */</span></div><div class="line"><a class="code" href="group__i2c.html#ga29f967b3ae8487a36ba2a58deb01ccae">I2C_MasterInit</a>(EXAMPLE_I2C_MASTER_BASEADDR, &amp;masterConfig, I2C_MASTER_CLK);</div><div class="line"></div><div class="line">masterXfer.<a class="code" href="group__i2c.html#a7b9ab02d5063e8653f0586395ccd7013">slaveAddress</a> = I2C_MASTER_SLAVE_ADDR_7BIT;</div><div class="line">masterXfer.<a class="code" href="group__i2c.html#aec93fd70f8f4f4cf2fafcbe0a4df08c2">direction</a> = <a class="code" href="group__i2c.html#ggab49c827b45635206f06e5737606e4611a93b476b469c2a4bfed5916b458ae9bb0">kI2C_Write</a>;</div><div class="line">masterXfer.<a class="code" href="group__i2c.html#a6fbfb5e5018422a177a9f3ed7269b127">subaddress</a> = NULL;</div><div class="line">masterXfer.<a class="code" href="group__i2c.html#ab690ec66e8cde484f919799fb1118cd6">subaddressSize</a> = 0;</div><div class="line">masterXfer.<a class="code" href="group__i2c.html#a6df23c71c49ca7371f41136934d4fad1">data</a> = txBuff;</div><div class="line">masterXfer.<a class="code" href="group__i2c.html#aec81567ca73e5b0cb790098785e345c5">dataSize</a> = BUFFER_SIZE;</div><div class="line">masterXfer.<a class="code" href="group__i2c.html#a773b39d480759f67926cb18ae2219281">flags</a> = <a class="code" href="group__i2c.html#gga87ea07668194cfb46c7c368d2cb42433ae80f7b768b1621e42ac965d3d23de5e2">kI2C_TransferDefaultFlag</a>;</div><div class="line"></div><div class="line">DMAMGR_RequestChannel((dma_request_source_t)DMA_REQUEST_SRC, 0, &amp;dmaHandle);</div><div class="line"></div><div class="line">I2C_MasterTransferCreateHandleDMA(EXAMPLE_I2C_MASTER_BASEADDR, &amp;g_m_dma_handle, i2c_master_callback, NULL, &amp;dmaHandle);</div><div class="line">I2C_MasterTransferDMA(EXAMPLE_I2C_MASTER_BASEADDR, &amp;g_m_dma_handle, &amp;masterXfer);</div><div class="line"></div><div class="line"><span class="comment">/*  Wait for transfer completed. */</span></div><div class="line"><span class="keywordflow">while</span> (!g_MasterCompletionFlag)</div><div class="line">{</div><div class="line">}</div><div class="line">g_MasterCompletionFlag = <span class="keyword">false</span>;</div></div><!-- fragment --><h2><a class="anchor" id="I2CSlaveOpsFunctional"></a>
Slave Operation in functional method</h2>
<div class="fragment"><div class="line"><a class="code" href="group__i2c.html#structi2c__slave__config__t">i2c_slave_config_t</a> slaveConfig;</div><div class="line">uint8_t status;</div><div class="line"><a class="code" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> result = kStatus_Success;</div><div class="line"></div><div class="line"><a class="code" href="group__i2c.html#ga7115f80e28b62bbbd3be1a2a918529ba">I2C_SlaveGetDefaultConfig</a>(&amp;slaveConfig); <span class="comment">/*default configuration 7-bit addressing mode*/</span></div><div class="line">slaveConfig.slaveAddr = 7-bit address</div><div class="line">slaveConfig.<a class="code" href="group__i2c.html#a2e946f1dfdd24a753f4c55a6ff3cc2e5">addressingMode</a> = <a class="code" href="group__i2c.html#ggac21e18657981bd7861f2ac5ebc5f633ba3e2c7f1f917939d0d7595224e3700dd4">kI2C_Address7bit</a>/<a class="code" href="group__i2c.html#ggac21e18657981bd7861f2ac5ebc5f633baa2c312f87691c542c466ff747d21f70a">kI2C_RangeMatch</a>;</div><div class="line"><a class="code" href="group__i2c.html#gae6e155a5aadb43d527418e2965e39123">I2C_SlaveInit</a>(EXAMPLE_I2C_SLAVE_BASEADDR, &amp;slaveConfig);</div><div class="line"></div><div class="line"><span class="comment">/* Wait address match. */</span></div><div class="line"><span class="keywordflow">while</span>(!((status = I2C_GetStatusFlag(EXAMPLE_I2C_SLAVE_BASEADDR)) &amp; <a class="code" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2a10cd5797b1b8f809192423486a85d5fe">kI2C_AddressMatchFlag</a>))</div><div class="line">{</div><div class="line"></div><div class="line">}</div><div class="line"></div><div class="line"><span class="comment">/* Slave transmit, master reading from slave. */</span></div><div class="line"><span class="keywordflow">if</span> (status &amp; <a class="code" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2a249f698970909f33b1b96139c05bd969">kI2C_TransferDirectionFlag</a>)</div><div class="line">{</div><div class="line">    result = <a class="code" href="group__i2c.html#ga280404c6b1ede542f2c1c20bd382869c">I2C_SlaveWriteBlocking</a>(EXAMPLE_I2C_SLAVE_BASEADDR);</div><div class="line">}</div><div class="line"><span class="keywordflow">else</span></div><div class="line">{</div><div class="line">    <a class="code" href="group__i2c.html#gaf7409e50ffd9b260744c13863c7a3987">I2C_SlaveReadBlocking</a>(EXAMPLE_I2C_SLAVE_BASEADDR);</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordflow">return</span> result;</div></div><!-- fragment --><h2><a class="anchor" id="I2CSlaveOpsTransIRQ"></a>
Slave Operation in interrupt transactional method</h2>
<div class="fragment"><div class="line"><a class="code" href="group__i2c.html#structi2c__slave__config__t">i2c_slave_config_t</a> slaveConfig;</div><div class="line">i2c_slave_handle_t g_s_handle;</div><div class="line"><span class="keyword">volatile</span> <span class="keywordtype">bool</span> g_SlaveCompletionFlag = <span class="keyword">false</span>;</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> i2c_slave_callback(I2C_Type *base, <a class="code" href="group__i2c.html#structi2c__slave__transfer__t">i2c_slave_transfer_t</a> *xfer, <span class="keywordtype">void</span> *userData)</div><div class="line">{</div><div class="line">    <span class="keywordflow">switch</span> (xfer-&gt;<a class="code" href="group__i2c.html#ad43dfdc1308f39dd4bff91414c1cce2c">event</a>)</div><div class="line">    {</div><div class="line">        <span class="comment">/*  Transmit request */</span></div><div class="line">        <span class="keywordflow">case</span> <a class="code" href="group__i2c.html#ggac53e5c96a2eed1b5a95b7d84be48f4aca2f85039a57379838909876a1d509b7aa">kI2C_SlaveTransmitEvent</a>:</div><div class="line">            <span class="comment">/*  Update information for transmit process */</span></div><div class="line">            xfer-&gt;<a class="code" href="group__i2c.html#a6df23c71c49ca7371f41136934d4fad1">data</a> = g_slave_buff;</div><div class="line">            xfer-&gt;<a class="code" href="group__i2c.html#aec81567ca73e5b0cb790098785e345c5">dataSize</a> = I2C_DATA_LENGTH;</div><div class="line">            <span class="keywordflow">break</span>;</div><div class="line"></div><div class="line">        <span class="comment">/*  Receive request */</span></div><div class="line">        <span class="keywordflow">case</span> <a class="code" href="group__i2c.html#ggac53e5c96a2eed1b5a95b7d84be48f4acaac8593e808a8137d1b5d3a51640779de">kI2C_SlaveReceiveEvent</a>:</div><div class="line">            <span class="comment">/*  Update information for received process */</span></div><div class="line">            xfer-&gt;<a class="code" href="group__i2c.html#a6df23c71c49ca7371f41136934d4fad1">data</a> = g_slave_buff;</div><div class="line">            xfer-&gt;<a class="code" href="group__i2c.html#aec81567ca73e5b0cb790098785e345c5">dataSize</a> = I2C_DATA_LENGTH;</div><div class="line">            <span class="keywordflow">break</span>;</div><div class="line"></div><div class="line">        <span class="comment">/*  Transfer done */</span></div><div class="line">        <span class="keywordflow">case</span> <a class="code" href="group__i2c.html#ggac53e5c96a2eed1b5a95b7d84be48f4aca38cca3cd668e73f51b8e574835d419df">kI2C_SlaveCompletionEvent</a>:</div><div class="line">            g_SlaveCompletionFlag = <span class="keyword">true</span>;</div><div class="line">            <span class="keywordflow">break</span>;</div><div class="line"></div><div class="line">        <span class="keywordflow">default</span>:</div><div class="line">            g_SlaveCompletionFlag = <span class="keyword">true</span>;</div><div class="line">            <span class="keywordflow">break</span>;</div><div class="line">    }</div><div class="line">}</div><div class="line"></div><div class="line"><a class="code" href="group__i2c.html#ga7115f80e28b62bbbd3be1a2a918529ba">I2C_SlaveGetDefaultConfig</a>(&amp;slaveConfig); <span class="comment">/*default configuration 7-bit addressing mode*/</span></div><div class="line">slaveConfig.slaveAddr = 7-bit address</div><div class="line">slaveConfig.<a class="code" href="group__i2c.html#a2e946f1dfdd24a753f4c55a6ff3cc2e5">addressingMode</a> = <a class="code" href="group__i2c.html#ggac21e18657981bd7861f2ac5ebc5f633ba3e2c7f1f917939d0d7595224e3700dd4">kI2C_Address7bit</a>/<a class="code" href="group__i2c.html#ggac21e18657981bd7861f2ac5ebc5f633baa2c312f87691c542c466ff747d21f70a">kI2C_RangeMatch</a>;</div><div class="line"></div><div class="line"><a class="code" href="group__i2c.html#gae6e155a5aadb43d527418e2965e39123">I2C_SlaveInit</a>(EXAMPLE_I2C_SLAVE_BASEADDR, &amp;slaveConfig);</div><div class="line"></div><div class="line"><a class="code" href="group__i2c.html#gac9b90f575d92ff8ad3cc350a5c8ad1b9">I2C_SlaveTransferCreateHandle</a>(EXAMPLE_I2C_SLAVE_BASEADDR, &amp;g_s_handle, i2c_slave_callback, NULL);</div><div class="line"></div><div class="line"><a class="code" href="group__i2c.html#gaa387d81ea08a9d4b39cfeb3dfec505f7">I2C_SlaveTransferNonBlocking</a>(EXAMPLE_I2C_SLAVE_BASEADDR, &amp;g_s_handle, <a class="code" href="group__i2c.html#ggac53e5c96a2eed1b5a95b7d84be48f4aca38cca3cd668e73f51b8e574835d419df">kI2C_SlaveCompletionEvent</a>);</div><div class="line"></div><div class="line"><span class="comment">/*  Wait for transfer completed. */</span></div><div class="line"><span class="keywordflow">while</span> (!g_SlaveCompletionFlag)</div><div class="line">{</div><div class="line">}</div><div class="line">g_SlaveCompletionFlag = <span class="keyword">false</span>;</div></div><!-- fragment --> <hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="structi2c__master__config__t" id="structi2c__master__config__t"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct i2c_master_config_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>I2C master user config. </p>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="aa5df547b4cb95d3c959373cf6fa672b5"></a>uint32_t</td>
<td class="fieldname">
baudRate_Bps</td>
<td class="fielddoc">
<p>Baud rate configuration of I2C peripheral. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="abfd79a5171ca9a694f18e9f6e634186c"></a>bool</td>
<td class="fieldname">
enableHighDrive</td>
<td class="fielddoc">
<p>Controls the drive capability of the I2C pads. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ab8b96ba3ced8b280ac1f366f6e76a9e7"></a>bool</td>
<td class="fieldname">
enableMaster</td>
<td class="fielddoc">
<p>Enables the I2C periperhal at init time. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ac9aaacb54567f1880fcaee7655cbbd79"></a>bool</td>
<td class="fieldname">
enableStopHold</td>
<td class="fielddoc">
<p>Controls the stop hold enable. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a0ec674bca5cb7bb8a6c51a44a5fc4314"></a>uint8_t</td>
<td class="fieldname">
glitchFilterWidth</td>
<td class="fielddoc">
<p>Controls the width of the glitch. </p>
</td></tr>
</table>

</div>
</div>
<a name="structi2c__slave__config__t" id="structi2c__slave__config__t"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct i2c_slave_config_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>I2C slave user config. </p>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a2e946f1dfdd24a753f4c55a6ff3cc2e5"></a><a class="el" href="group__i2c.html#gac21e18657981bd7861f2ac5ebc5f633b">i2c_slave_address_mode_t</a></td>
<td class="fieldname">
addressingMode</td>
<td class="fielddoc">
<p>Addressing mode configuration of i2c_slave_address_mode_config_t. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a788ff5c58438afe177059bf0d3c78d5a"></a>bool</td>
<td class="fieldname">
enableBaudRateCtl</td>
<td class="fielddoc">
<p>Enables/disables independent slave baudrate on SCL in very fast I2C modes. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="aedb9cfa838d8a677d9193d5c92298ea4"></a>bool</td>
<td class="fieldname">
enableGeneralCall</td>
<td class="fielddoc">
<p>Enable general call addressing mode. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="abfd79a5171ca9a694f18e9f6e634186c"></a>bool</td>
<td class="fieldname">
enableHighDrive</td>
<td class="fielddoc">
<p>Controls the drive capability of the I2C pads. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a9189d8f6438ba99548837da162213c46"></a>bool</td>
<td class="fieldname">
enableSlave</td>
<td class="fielddoc">
<p>Enables the I2C periperhal at init time. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="af1f3df39054da492f1da50ca792676af"></a>bool</td>
<td class="fieldname">
enableWakeUp</td>
<td class="fielddoc">
<p>Enables/disables waking up MCU from low power mode. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a67af74c3fc959654c6dc8bcff3a2ea80"></a>uint16_t</td>
<td class="fieldname">
slaveAddress</td>
<td class="fielddoc">
<p>Slave address configuration. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a959e9269b2e7e83f1c4aebac870bf822"></a>uint16_t</td>
<td class="fieldname">
upperAddress</td>
<td class="fielddoc">
<p>Maximum boundary slave address used in range matching mode. </p>
</td></tr>
</table>

</div>
</div>
<a name="structi2c__master__transfer__t" id="structi2c__master__transfer__t"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct i2c_master_transfer_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>I2C master transfer structure. </p>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a6df23c71c49ca7371f41136934d4fad1"></a>uint8_t *volatile</td>
<td class="fieldname">
data</td>
<td class="fielddoc">
<p>Transfer buffer. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="aec81567ca73e5b0cb790098785e345c5"></a>volatile size_t</td>
<td class="fieldname">
dataSize</td>
<td class="fielddoc">
<p>Transfer size. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="aec93fd70f8f4f4cf2fafcbe0a4df08c2"></a><a class="el" href="group__i2c.html#gab49c827b45635206f06e5737606e4611">i2c_direction_t</a></td>
<td class="fieldname">
direction</td>
<td class="fielddoc">
<p>Transfer direction, read or write. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a773b39d480759f67926cb18ae2219281"></a>uint32_t</td>
<td class="fieldname">
flags</td>
<td class="fielddoc">
<p>Transfer flag which controls the transfer. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a7b9ab02d5063e8653f0586395ccd7013"></a>uint8_t</td>
<td class="fieldname">
slaveAddress</td>
<td class="fielddoc">
<p>7-bit slave address. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a6fbfb5e5018422a177a9f3ed7269b127"></a>uint32_t</td>
<td class="fieldname">
subaddress</td>
<td class="fielddoc">
<p>Subaddress. Transferred MSB first. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ab690ec66e8cde484f919799fb1118cd6"></a>uint8_t</td>
<td class="fieldname">
subaddressSize</td>
<td class="fielddoc">
<p>Size of command buffer. </p>
</td></tr>
</table>

</div>
</div>
<a name="struct__i2c__master__handle" id="struct__i2c__master__handle"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct _i2c_master_handle</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>I2C master handle structure. </p>
<p>I2C master handle typedef. </p>
</div><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Collaboration diagram for i2c_master_handle_t:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" frameborder="0" src="struct__i2c__master__handle__coll__graph.svg" width="158" height="127"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ab886e4f1a8a9cd0953a6dc2b0f33e87c"></a><a class="el" href="group__i2c.html#gafa39d30cd808d79b774361874f227204">i2c_master_transfer_callback_t</a></td>
<td class="fieldname">
completionCallback</td>
<td class="fielddoc">
<p>Callback function called when transfer finished. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a0b57aa10271a66f3dc936bba1d2f3830"></a>uint8_t</td>
<td class="fieldname">
state</td>
<td class="fielddoc">
<p>Transfer state maintained during transfer. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a9f792796934731101c55954d82000811"></a><a class="el" href="group__i2c.html#structi2c__master__transfer__t">i2c_master_transfer_t</a></td>
<td class="fieldname">
transfer</td>
<td class="fielddoc">
<p>I2C master transfer copy. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a10e6d1f095e525fa85ffe957081ed7a7"></a>size_t</td>
<td class="fieldname">
transferSize</td>
<td class="fielddoc">
<p>Total bytes to be transferred. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a2e294dd14122c554baa0665072b4ca7a"></a>void *</td>
<td class="fieldname">
userData</td>
<td class="fielddoc">
<p>Callback parameter passed to callback function. </p>
</td></tr>
</table>

</div>
</div>
<a name="structi2c__slave__transfer__t" id="structi2c__slave__transfer__t"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct i2c_slave_transfer_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>I2C slave transfer structure. </p>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="aac6aa92f2aef99293ab2f5ad6f734fad"></a><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a></td>
<td class="fieldname">
completionStatus</td>
<td class="fielddoc">
<p>Success or error code describing how the transfer completed. Only applies for <a class="el" href="group__i2c.html#ggac53e5c96a2eed1b5a95b7d84be48f4aca38cca3cd668e73f51b8e574835d419df">kI2C_SlaveCompletionEvent</a>. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a6df23c71c49ca7371f41136934d4fad1"></a>uint8_t *volatile</td>
<td class="fieldname">
data</td>
<td class="fielddoc">
<p>Transfer buffer. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="aec81567ca73e5b0cb790098785e345c5"></a>volatile size_t</td>
<td class="fieldname">
dataSize</td>
<td class="fielddoc">
<p>Transfer size. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ad43dfdc1308f39dd4bff91414c1cce2c"></a><a class="el" href="group__i2c.html#gac53e5c96a2eed1b5a95b7d84be48f4ac">i2c_slave_transfer_event_t</a></td>
<td class="fieldname">
event</td>
<td class="fielddoc">
<p>Reason the callback is being invoked. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a97856cb5d71b7981d4ce9813124a5433"></a>size_t</td>
<td class="fieldname">
transferredCount</td>
<td class="fielddoc">
<p>Number of bytes actually transferred since start or last repeated start. </p>
</td></tr>
</table>

</div>
</div>
<a name="struct__i2c__slave__handle" id="struct__i2c__slave__handle"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct _i2c_slave_handle</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>I2C slave handle structure. </p>
<p>I2C slave handle typedef. </p>
</div><div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-1-trigger" src="closed.png" alt="+"/> Collaboration diagram for i2c_slave_handle_t:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" frameborder="0" src="struct__i2c__slave__handle__coll__graph.svg" width="147" height="142"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a8630826ced50476e2c1446747c3b2f03"></a><a class="el" href="group__i2c.html#ga2583e3d8ebf8d3de410d8b6263238c35">i2c_slave_transfer_callback_t</a></td>
<td class="fieldname">
callback</td>
<td class="fielddoc">
<p>Callback function called at transfer event. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="acf2922a79dce3fb9f7c7fe948de1f5a8"></a>uint32_t</td>
<td class="fieldname">
eventMask</td>
<td class="fielddoc">
<p>Mask of enabled events. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a099f725f22a344e190121634f53328d8"></a>bool</td>
<td class="fieldname">
isBusy</td>
<td class="fielddoc">
<p>Whether transfer is busy. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a8cfa005502ce2f110a54f99672380f5f"></a><a class="el" href="group__i2c.html#structi2c__slave__transfer__t">i2c_slave_transfer_t</a></td>
<td class="fieldname">
transfer</td>
<td class="fielddoc">
<p>I2C slave transfer copy. </p>
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a2e294dd14122c554baa0665072b4ca7a"></a>void *</td>
<td class="fieldname">
userData</td>
<td class="fielddoc">
<p>Callback parameter passed to callback. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="ga1f1337bbe9d0b184d9dcee31f9ebade2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__i2c.html#ga1f1337bbe9d0b184d9dcee31f9ebade2">_i2c_flags</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>I2C peripheral flags. </p>
<p>The following status register flags can be cleared:</p><ul>
<li><a class="el" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2a39fab5ef04e74d00ef4c4574899ab589">kI2C_ArbitrationLostFlag</a></li>
<li><a class="el" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2a647d0b1d1f9514ad483bef3ea3926c3b">kI2C_IntPendingFlag</a></li>
<li><a class="el" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2a07e611eaff148acca64fae7f1f0e1577">kI2C_StartDetectFlag</a></li>
<li><a class="el" href="group__i2c.html#gga1f1337bbe9d0b184d9dcee31f9ebade2a942f41cfdfcd976ab26e77ce95c386ae">kI2C_StopDetectFlag</a></li>
</ul>
<dl class="section note"><dt>Note</dt><dd>These enums are meant to be OR'd together to form a bit mask. </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="gga1f1337bbe9d0b184d9dcee31f9ebade2a4c3c2928e17ddbfbc1c346c6b9a8dccd"></a>kI2C_ReceiveNakFlag&#160;</td><td class="fielddoc">
<p>I2C receive nak flag. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga1f1337bbe9d0b184d9dcee31f9ebade2a647d0b1d1f9514ad483bef3ea3926c3b"></a>kI2C_IntPendingFlag&#160;</td><td class="fielddoc">
<p>I2C interrupt pending flag. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga1f1337bbe9d0b184d9dcee31f9ebade2a249f698970909f33b1b96139c05bd969"></a>kI2C_TransferDirectionFlag&#160;</td><td class="fielddoc">
<p>I2C transfer direction flag. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga1f1337bbe9d0b184d9dcee31f9ebade2aac2c3a26d38c01fba1554eddc0c6b8b5"></a>kI2C_RangeAddressMatchFlag&#160;</td><td class="fielddoc">
<p>I2C range address match flag. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga1f1337bbe9d0b184d9dcee31f9ebade2a39fab5ef04e74d00ef4c4574899ab589"></a>kI2C_ArbitrationLostFlag&#160;</td><td class="fielddoc">
<p>I2C arbitration lost flag. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga1f1337bbe9d0b184d9dcee31f9ebade2a37fb20742a15a63c1bc2551b997cdcff"></a>kI2C_BusBusyFlag&#160;</td><td class="fielddoc">
<p>I2C bus busy flag. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga1f1337bbe9d0b184d9dcee31f9ebade2a10cd5797b1b8f809192423486a85d5fe"></a>kI2C_AddressMatchFlag&#160;</td><td class="fielddoc">
<p>I2C address match flag. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga1f1337bbe9d0b184d9dcee31f9ebade2adb8f10365dfc2a3e849f05173fa4d83e"></a>kI2C_TransferCompleteFlag&#160;</td><td class="fielddoc">
<p>I2C transfer complete flag. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga1f1337bbe9d0b184d9dcee31f9ebade2a942f41cfdfcd976ab26e77ce95c386ae"></a>kI2C_StopDetectFlag&#160;</td><td class="fielddoc">
<p>I2C stop detect flag. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga1f1337bbe9d0b184d9dcee31f9ebade2a07e611eaff148acca64fae7f1f0e1577"></a>kI2C_StartDetectFlag&#160;</td><td class="fielddoc">
<p>I2C start detect flag. </p>
</td></tr>
</table>

</div>
</div>
<a class="anchor" id="ga87c81dd985dad07dc26cb93125a94ec7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__i2c.html#ga87c81dd985dad07dc26cb93125a94ec7">_i2c_interrupt_enable</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>I2C feature interrupt source. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="gga87c81dd985dad07dc26cb93125a94ec7a5526e27ef6e8317ba928849da890b3b2"></a>kI2C_GlobalInterruptEnable&#160;</td><td class="fielddoc">
<p>I2C global interrupt. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga87c81dd985dad07dc26cb93125a94ec7a3d36e9fb0895af1f915abdd66dd7e77c"></a>kI2C_StopDetectInterruptEnable&#160;</td><td class="fielddoc">
<p>I2C stop detect interrupt. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga87c81dd985dad07dc26cb93125a94ec7a3accfbb04bdb6e48e40927efa2269390"></a>kI2C_StartStopDetectInterruptEnable&#160;</td><td class="fielddoc">
<p>I2C start&amp;stop detect interrupt. </p>
</td></tr>
</table>

</div>
</div>
<a class="anchor" id="ga87ea07668194cfb46c7c368d2cb42433"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__i2c.html#ga87ea07668194cfb46c7c368d2cb42433">_i2c_master_transfer_flags</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>I2C transfer control flag. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="gga87ea07668194cfb46c7c368d2cb42433ae80f7b768b1621e42ac965d3d23de5e2"></a>kI2C_TransferDefaultFlag&#160;</td><td class="fielddoc">
<p>Transfer starts with a start signal, stops with a stop signal. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga87ea07668194cfb46c7c368d2cb42433a5cb44bf860c0482c0ca0165cf0d31d8a"></a>kI2C_TransferNoStartFlag&#160;</td><td class="fielddoc">
<p>Transfer starts without a start signal. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga87ea07668194cfb46c7c368d2cb42433aadf112471ef12f194985a093cd9b9721"></a>kI2C_TransferRepeatedStartFlag&#160;</td><td class="fielddoc">
<p>Transfer starts with a repeated start signal. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga87ea07668194cfb46c7c368d2cb42433afb8aeea71b5b7475e3d3df86220db566"></a>kI2C_TransferNoStopFlag&#160;</td><td class="fielddoc">
<p>Transfer ends without a stop signal. </p>
</td></tr>
</table>

</div>
</div>
<a class="anchor" id="ga7cc91c89125c25a88e463a9e8550b284"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__i2c.html#ga7cc91c89125c25a88e463a9e8550b284">_i2c_status</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>I2C status return codes. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="gga7cc91c89125c25a88e463a9e8550b284a49091894b590d7e479605bf113918952"></a>kStatus_I2C_Busy&#160;</td><td class="fielddoc">
<p>I2C is busy with current transfer. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga7cc91c89125c25a88e463a9e8550b284a628d242f7bc0e3d5949c7f73eafaa508"></a>kStatus_I2C_Idle&#160;</td><td class="fielddoc">
<p>Bus is Idle. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga7cc91c89125c25a88e463a9e8550b284a72fd33d0b5263a63766e62f71d16be00"></a>kStatus_I2C_Nak&#160;</td><td class="fielddoc">
<p>NAK received during transfer. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga7cc91c89125c25a88e463a9e8550b284a139b52cc3305ec2c06d0ac94313c221f"></a>kStatus_I2C_ArbitrationLost&#160;</td><td class="fielddoc">
<p>Arbitration lost during transfer. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga7cc91c89125c25a88e463a9e8550b284a81ad7cc198436cabbe91ea55c5288747"></a>kStatus_I2C_Timeout&#160;</td><td class="fielddoc">
<p>Wait event timeout. </p>
</td></tr>
</table>

</div>
</div>
<a class="anchor" id="gab49c827b45635206f06e5737606e4611"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__i2c.html#gab49c827b45635206f06e5737606e4611">i2c_direction_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Direction of master and slave transfers. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="ggab49c827b45635206f06e5737606e4611a93b476b469c2a4bfed5916b458ae9bb0"></a>kI2C_Write&#160;</td><td class="fielddoc">
<p>Master transmit to slave. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggab49c827b45635206f06e5737606e4611a3a7bb24dc8d1c1be8925603eeafe9b30"></a>kI2C_Read&#160;</td><td class="fielddoc">
<p>Master receive from slave. </p>
</td></tr>
</table>

</div>
</div>
<a class="anchor" id="gac21e18657981bd7861f2ac5ebc5f633b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__i2c.html#gac21e18657981bd7861f2ac5ebc5f633b">i2c_slave_address_mode_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Addressing mode. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="ggac21e18657981bd7861f2ac5ebc5f633ba3e2c7f1f917939d0d7595224e3700dd4"></a>kI2C_Address7bit&#160;</td><td class="fielddoc">
<p>7-bit addressing mode. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggac21e18657981bd7861f2ac5ebc5f633baa2c312f87691c542c466ff747d21f70a"></a>kI2C_RangeMatch&#160;</td><td class="fielddoc">
<p>Range address match addressing mode. </p>
</td></tr>
</table>

</div>
</div>
<a class="anchor" id="gac53e5c96a2eed1b5a95b7d84be48f4ac"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__i2c.html#gac53e5c96a2eed1b5a95b7d84be48f4ac">i2c_slave_transfer_event_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set of events sent to the callback for nonblocking slave transfers. </p>
<p>These event enums are used for two related purposes. First, a bit mask created by OR'ing together events is passed to <a class="el" href="group__i2c.html#gaa387d81ea08a9d4b39cfeb3dfec505f7" title="Start accepting slave transfers. ">I2C_SlaveTransferNonBlocking()</a> in order to specify which events to enable. Then, when the slave callback is invoked, it is passed the current event through its <em>transfer</em> parameter.</p>
<dl class="section note"><dt>Note</dt><dd>These enums are meant to be OR'd together to form a bit mask of events. </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="ggac53e5c96a2eed1b5a95b7d84be48f4acacb1ae174dd6798a6fd79800a9e39a3c6"></a>kI2C_SlaveAddressMatchEvent&#160;</td><td class="fielddoc">
<p>Received the slave address after a start or repeated start. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggac53e5c96a2eed1b5a95b7d84be48f4aca2f85039a57379838909876a1d509b7aa"></a>kI2C_SlaveTransmitEvent&#160;</td><td class="fielddoc">
<p>Callback is requested to provide data to transmit (slave-transmitter role). </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggac53e5c96a2eed1b5a95b7d84be48f4acaac8593e808a8137d1b5d3a51640779de"></a>kI2C_SlaveReceiveEvent&#160;</td><td class="fielddoc">
<p>Callback is requested to provide a buffer in which to place received data (slave-receiver role). </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggac53e5c96a2eed1b5a95b7d84be48f4aca43c045da27fa60e7a0540c743eca4e79"></a>kI2C_SlaveTransmitAckEvent&#160;</td><td class="fielddoc">
<p>Callback needs to either transmit an ack or nack. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggac53e5c96a2eed1b5a95b7d84be48f4aca4c7de9b9d0c71a86ef6bd5cd6a39dad5"></a>kI2C_SlaveRepeatedStartEvent&#160;</td><td class="fielddoc">
<p>A repeated start was detected. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggac53e5c96a2eed1b5a95b7d84be48f4aca38cca3cd668e73f51b8e574835d419df"></a>kI2C_SlaveCompletionEvent&#160;</td><td class="fielddoc">
<p>A stop was detected or finished transfer, completing the transfer. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggac53e5c96a2eed1b5a95b7d84be48f4aca94b030ebdac378a84961893ae567bfbc"></a>kI2C_SlaveAllEvents&#160;</td><td class="fielddoc">
<p>Bit mask of all available events. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga9839c1fd49a0f62f42b0adfa74f62853"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void I2C_DisableInterrupts </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disable I2C interrupt requests. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer </td></tr>
    <tr><td class="paramname">mask</td><td>interrupt source The parameter can be combination of the following source if defined: <ul>
<li>kI2C_GlobalInterruptEnable </li>
<li>kI2C_StopDetectInterruptEnable/kI2C_StartDetectInterruptEnable </li>
<li>kI2C_SdaTimeoutInterruptEnable </li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaaaaab1e83cb8c6117046bdb5bcbf9ac6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void I2C_Enable </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Enable or disables the I2C peripheral operation. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer </td></tr>
    <tr><td class="paramname">enable</td><td>pass true to enable module, false to disable module </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gac1c7c015a74aa0e2c8cd7df6dbf7fb71"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void I2C_EnableDMA </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Enables/disables the I2C DMA interrupt. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer </td></tr>
    <tr><td class="paramname">enable</td><td>true for enable, false for diable </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga577e094cc4d39b88ec5bbe49bc199c77"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void I2C_EnableInterrupts </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enable I2C interrupt requests. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer </td></tr>
    <tr><td class="paramname">mask</td><td>interrupt source The parameter can be combination of the following source if defined: <ul>
<li>kI2C_GlobalInterruptEnable </li>
<li>kI2C_StopDetectInterruptEnable/kI2C_StartDetectInterruptEnable </li>
<li>kI2C_SdaTimeoutInterruptEnable </li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaf3238d6c3de8e7e8aa7a6c3a8d645769"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint32_t I2C_GetDataRegAddr </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get I2C tx/rx data register address This API is used to provide transfer address for I2C DMA transfer configuration. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>data register address </dd></dl>

</div>
</div>
<a class="anchor" id="ga437271ffb955b77df0a5dee9ea80cc63"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void I2C_MasterClearStatusFlags </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>statusMask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Clears the I2C status flag state. </p>
<p>The following status register flags can be cleared: kI2C_ArbitrationLostFlag and kI2C_IntPendingFlag</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer </td></tr>
    <tr><td class="paramname">statusMask</td><td>The status flag mask, defined in type i2c_status_flag_t. The parameter could be any combination of the following values: <ul>
<li>kI2C_StartDetectFlag (if available) </li>
<li>kI2C_StopDetectFlag (if available) </li>
<li>kI2C_ArbitrationLostFlag </li>
<li>kI2C_IntPendingFlagFlag </li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gadcf7122f0a38d4d9da0f052fcb167957"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void I2C_MasterDeinit </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>De-initialize the I2C master peripheral, call thi API will gate the i2c clock, so the I2C master module can not work unless call I2C_MasterInit. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gad69f2d63ea756dda60749ff6b09f587d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void I2C_MasterGetDefaultConfig </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__i2c.html#structi2c__master__config__t">i2c_master_config_t</a> *&#160;</td>
          <td class="paramname"><em>masterConfig</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the I2C master configuration structure to default values. </p>
<p>The purpose of this API is to get the config structure initialized for use in I2C_MasterConfigure(). User may use the initialized structure unchanged in I2C_MasterConfigure(), or modify some fields of the structure before calling I2C_MasterConfigure(). Example: </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;i2c_master_config_t config;</div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;I2C_MasterGetDefaultConfig(&amp;config);</div></div><!-- fragment --> <dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">masterConfig</td><td>Pointer to the master config structure. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga721e41295dedc83b424e80e53065e625"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t I2C_MasterGetStatusFlags </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the I2C status flags. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>status flag, use status flag to AND <a class="el" href="group__i2c.html#ga1f1337bbe9d0b184d9dcee31f9ebade2" title="I2C peripheral flags. ">_i2c_flags</a> could get the related status. </dd></dl>

</div>
</div>
<a class="anchor" id="ga29f967b3ae8487a36ba2a58deb01ccae"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void I2C_MasterInit </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__i2c.html#structi2c__master__config__t">i2c_master_config_t</a> *&#160;</td>
          <td class="paramname"><em>masterConfig</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>srcClock_Hz</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the I2C peripheral, call this API to ungate the i2c clock and configure the I2C with master configuration. </p>
<dl class="section note"><dt>Note</dt><dd>This API should be called at the beginning of the application to use the i2c driver, or any operation to the i2c module could cause hard fault because clock is not enabled. The configuration structure can be filled by user from scratch, or be set with default values by <a class="el" href="group__i2c.html#gad69f2d63ea756dda60749ff6b09f587d" title="Set the I2C master configuration structure to default values. ">I2C_MasterGetDefaultConfig()</a>. After calling this API, the master is ready to transfer. Example: <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;i2c_master_config_t config = {</div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;.enableMaster = true,</div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;.enableStopHold = false,</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;.highDrive = false,</div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;.baudRate_Bps = 100000,</div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;.glitchFilterWidth = 0</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;};</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;I2C_MasterInit(I2C0, &amp;config, 12000000U);</div></div><!-- fragment --></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer </td></tr>
    <tr><td class="paramname">masterConfig</td><td>pointer to master config structure </td></tr>
    <tr><td class="paramname">srcClock_Hz</td><td>I2C pheripharal clock frequency in HZ </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga815e953753bbfeea5277b527b16ac23e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> I2C_MasterReadBlocking </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>rxBuff</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>rxSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Performs a polling receive transaction on the I2C bus with a STOP signal. </p>
<dl class="section note"><dt>Note</dt><dd>The I2C_MasterReadBlocking function will STOP the bus before the read of the final byte. Without stopping the bus prior to the final read, the bus will issue another read, resulting in garbage data being read into the data register.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C peripheral base pointer. </td></tr>
    <tr><td class="paramname">rxBuff</td><td>The pointer to the data to store the received data. </td></tr>
    <tr><td class="paramname">rxSize</td><td>The length in bytes of the data to be received. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td>Sucessully complete the data transmission. </td></tr>
    <tr><td class="paramname">kStatus_I2C_Timeout</td><td>Send stop signal failed, timeout. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga42ff265d25e713326c7d152adf350147"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> I2C_MasterRepeatedStart </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__i2c.html#gab49c827b45635206f06e5737606e4611">i2c_direction_t</a>&#160;</td>
          <td class="paramname"><em>direction</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sends a REPEATED START on the I2C bus. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C peripheral base pointer </td></tr>
    <tr><td class="paramname">address</td><td>7-bit slave device address. </td></tr>
    <tr><td class="paramname">direction</td><td>Master transfer directions(transmit/receive). </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td>Sucessully send the start signal. </td></tr>
    <tr><td class="paramname">kStatus_I2C_Busy</td><td>Current bus is busy but not occupied by current i2c master. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gafeab1d5249a8b39c8d9e1a54a85c23f0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void I2C_MasterSetBaudRate </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>baudRate_Bps</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>srcClock_Hz</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the I2C master transfer baudrate. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer </td></tr>
    <tr><td class="paramname">baudRate_Bps</td><td>the baud rate value in bps </td></tr>
    <tr><td class="paramname">srcClock_Hz</td><td>Source clock </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga7664234966e4162e952b6d57efcaa8a6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> I2C_MasterStart </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__i2c.html#gab49c827b45635206f06e5737606e4611">i2c_direction_t</a>&#160;</td>
          <td class="paramname"><em>direction</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sends a START on the I2C bus. </p>
<p>This function is used to initiate a new master mode transfer by sending the START signal. The slave address will be sent following the I2C START signal.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C peripheral base pointer </td></tr>
    <tr><td class="paramname">address</td><td>7-bit slave device address. </td></tr>
    <tr><td class="paramname">direction</td><td>Master transfer directions(transmit/receive). </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td>Sucessully send the start signal. </td></tr>
    <tr><td class="paramname">kStatus_I2C_Busy</td><td>Current bus is busy. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaf46a8cc094fc18c6cadea8de71448723"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> I2C_MasterStop </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sends a STOP signal on the I2C bus. </p>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td>Sucessully send the stop signal. </td></tr>
    <tr><td class="paramname">kStatus_I2C_Timeout</td><td>Send stop signal failed, timeout. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga77c9f9c8bc0fe71bbcd9d479f51f8044"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void I2C_MasterTransferAbort </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i2c_master_handle_t *&#160;</td>
          <td class="paramname"><em>handle</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Abort a interrupt non-blocking transfer in a early time. </p>
<dl class="section note"><dt>Note</dt><dd>This API could be called at any time when interrupt non-blocking transfer initiates to abort the transfer in a early time.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer. </td></tr>
    <tr><td class="paramname">handle</td><td>pointer to i2c_master_handle_t structure which stores the transfer state </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga35cae3a5b4aa50ce8db28e3eb703a027"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> I2C_MasterTransferBlocking </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__i2c.html#structi2c__master__transfer__t">i2c_master_transfer_t</a> *&#160;</td>
          <td class="paramname"><em>xfer</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Performs a master polling transfer on the I2C bus. </p>
<dl class="section note"><dt>Note</dt><dd>Calling the API will not return until the transfer succeeds or fails due to arbitration lost or receiving a NAK.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C peripheral base address. </td></tr>
    <tr><td class="paramname">xfer</td><td>Pointer to the transfer structure. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td>Sucessully complete the data transmission. </td></tr>
    <tr><td class="paramname">kStatus_I2C_Busy</td><td>Previous transmission still not finished. </td></tr>
    <tr><td class="paramname">kStatus_I2C_Timeout</td><td>Transfer error, wait signal timeout. </td></tr>
    <tr><td class="paramname">kStatus_I2C_ArbitrationLost</td><td>Transfer error, arbitration lost. </td></tr>
    <tr><td class="paramname">kStataus_I2C_Nak</td><td>Transfer error, receive Nak during transfer. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga31e3de02b57801c6896e6045c4a31268"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void I2C_MasterTransferCreateHandle </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i2c_master_handle_t *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__i2c.html#gafa39d30cd808d79b774361874f227204">i2c_master_transfer_callback_t</a>&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>userData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Init the I2C handle which is used in transactional functions. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer. </td></tr>
    <tr><td class="paramname">handle</td><td>pointer to i2c_master_handle_t structure to store the transfer state. </td></tr>
    <tr><td class="paramname">callback</td><td>pointer to user callback function. </td></tr>
    <tr><td class="paramname">userData</td><td>user param passed to the callback function. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga7d720842e68161d2d52d56d119f20665"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> I2C_MasterTransferGetCount </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i2c_master_handle_t *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get master transfer status during a interrupt non-blocking transfer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer. </td></tr>
    <tr><td class="paramname">handle</td><td>pointer to i2c_master_handle_t structure which stores the transfer state. </td></tr>
    <tr><td class="paramname">count</td><td>Number of bytes transferred so far by the non-blocking transaction. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_InvalidArgument</td><td>count is Invalid. </td></tr>
    <tr><td class="paramname">kStatus_Success</td><td>Successfully return the count. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gad091cd1857d2bd8ce64583739b3a35d5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void I2C_MasterTransferHandleIRQ </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>i2cHandle</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Master interrupt handler. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer. </td></tr>
    <tr><td class="paramname">i2cHandle</td><td>pointer to i2c_master_handle_t structure. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gac7f76a04b6f6873c52ad176d58901fe9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> I2C_MasterTransferNonBlocking </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i2c_master_handle_t *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__i2c.html#structi2c__master__transfer__t">i2c_master_transfer_t</a> *&#160;</td>
          <td class="paramname"><em>xfer</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Performs a master interrupt non-blocking transfer on the I2C bus. </p>
<dl class="section note"><dt>Note</dt><dd>Calling the API will return immediately after transfer initiates, user needs to call I2C_MasterGetTransferCount to poll the transfer status to check whether the transfer is finished, if the return status is not kStatus_I2C_Busy, the transfer is finished.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer. </td></tr>
    <tr><td class="paramname">handle</td><td>pointer to i2c_master_handle_t structure which stores the transfer state. </td></tr>
    <tr><td class="paramname">xfer</td><td>pointer to <a class="el" href="group__i2c.html#structi2c__master__transfer__t" title="I2C master transfer structure. ">i2c_master_transfer_t</a> structure. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td>Sucessully start the data transmission. </td></tr>
    <tr><td class="paramname">kStatus_I2C_Busy</td><td>Previous transmission still not finished. </td></tr>
    <tr><td class="paramname">kStatus_I2C_Timeout</td><td>Transfer error, wait signal timeout. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaba0a9e727e5a141b59b67f10a24dc9e6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> I2C_MasterWriteBlocking </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>txBuff</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>txSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Performs a polling send transaction on the I2C bus without a STOP signal. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The I2C peripheral base pointer. </td></tr>
    <tr><td class="paramname">txBuff</td><td>The pointer to the data to be transferred. </td></tr>
    <tr><td class="paramname">txSize</td><td>The length in bytes of the data to be transferred. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td>Sucessully complete the data transmission. </td></tr>
    <tr><td class="paramname">kStatus_I2C_ArbitrationLost</td><td>Transfer error, arbitration lost. </td></tr>
    <tr><td class="paramname">kStataus_I2C_Nak</td><td>Transfer error, receive Nak during transfer. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga545c1a43d8d49c4675de493d45a4063a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void I2C_SlaveClearStatusFlags </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>statusMask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Clears the I2C status flag state. </p>
<p>The following status register flags can be cleared: kI2C_ArbitrationLostFlag and kI2C_IntPendingFlag</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer </td></tr>
    <tr><td class="paramname">statusMask</td><td>The status flag mask, defined in type i2c_status_flag_t. The parameter could be any combination of the following values: <ul>
<li>kI2C_StartDetectFlag (if available) </li>
<li>kI2C_StopDetectFlag (if available) </li>
<li>kI2C_ArbitrationLostFlag </li>
<li>kI2C_IntPendingFlagFlag </li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gadb50014db29dd75ea2001fb7bc837e77"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void I2C_SlaveDeinit </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>De-initialize the I2C slave peripheral, call thi API will gate the i2c clock, so the I2C slave module can not work unless call I2C_SlaveInit to enable the clock. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga7115f80e28b62bbbd3be1a2a918529ba"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void I2C_SlaveGetDefaultConfig </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__i2c.html#structi2c__slave__config__t">i2c_slave_config_t</a> *&#160;</td>
          <td class="paramname"><em>slaveConfig</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the I2C slave configuration structure to default values. </p>
<p>The purpose of this API is to get the config structure initialized for use in I2C_SlaveConfigure(). User needs to modify some fields of the structure before calling I2C_SlaveConfigure(). Example: </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;i2c_slave_config_t config;</div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;I2C_SlaveGetDefaultConfig(&amp;config);</div></div><!-- fragment --> <dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">slaveConfig</td><td>Pointer to the slave config structure. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gac2794e138d94d9b6a761c074ad0899cd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint32_t I2C_SlaveGetStatusFlags </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets the I2C status flags. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>status flag, use status flag to AND <a class="el" href="group__i2c.html#ga1f1337bbe9d0b184d9dcee31f9ebade2" title="I2C peripheral flags. ">_i2c_flags</a> could get the related status. </dd></dl>

</div>
</div>
<a class="anchor" id="gae6e155a5aadb43d527418e2965e39123"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void I2C_SlaveInit </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__i2c.html#structi2c__slave__config__t">i2c_slave_config_t</a> *&#160;</td>
          <td class="paramname"><em>slaveConfig</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the I2C peripheral, call this API to ungate the i2c clock and initializes the I2C with slave configuration. </p>
<dl class="section note"><dt>Note</dt><dd>This API should be called at the beginning of the application to use the i2c driver, or any operation to the i2c module could cause hard fault because clock is not enabled. The configuration structure could partly be set with default values by <a class="el" href="group__i2c.html#ga7115f80e28b62bbbd3be1a2a918529ba" title="Set the I2C slave configuration structure to default values. ">I2C_SlaveGetDefaultConfig()</a>, or can be filled by user from scratch. Example <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;i2c_slave_config_t config = {</div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;.enableSlave = true,</div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;.enableGeneralCall = false,</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;.addressingMode = kI2C_Address7bit,</div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;.slaveAddress = 0x1DU,</div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;.enableWakeUp = false,</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;.enablehighDrive = false,</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;.enableBaudRateCtl = false</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;};</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;I2C_SlaveInit(I2C0, &amp;config);</div></div><!-- fragment --></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer </td></tr>
    <tr><td class="paramname">slaveConfig</td><td>pointer to slave config structure </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaf7409e50ffd9b260744c13863c7a3987"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void I2C_SlaveReadBlocking </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>rxBuff</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>rxSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Performs a polling receive transaction on the I2C bus. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C peripheral base pointer. </td></tr>
    <tr><td class="paramname">rxBuff</td><td>The pointer to the data to store the received data. </td></tr>
    <tr><td class="paramname">rxSize</td><td>The length in bytes of the data to be received. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga5ae9f5e6e854d14d33ba3029128bd6f0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void I2C_SlaveTransferAbort </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i2c_slave_handle_t *&#160;</td>
          <td class="paramname"><em>handle</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Abort slave transfer. </p>
<dl class="section note"><dt>Note</dt><dd>This API could be called at any time to stop slave for handling the bus events.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer. </td></tr>
    <tr><td class="paramname">handle</td><td>pointer to i2c_slave_handle_t structure which stores the transfer state. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gac9b90f575d92ff8ad3cc350a5c8ad1b9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void I2C_SlaveTransferCreateHandle </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i2c_slave_handle_t *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__i2c.html#ga2583e3d8ebf8d3de410d8b6263238c35">i2c_slave_transfer_callback_t</a>&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>userData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Init the I2C handle which is used in transcational functions. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer. </td></tr>
    <tr><td class="paramname">handle</td><td>pointer to i2c_slave_handle_t structure to store the transfer state. </td></tr>
    <tr><td class="paramname">callback</td><td>pointer to user callback function. </td></tr>
    <tr><td class="paramname">userData</td><td>user param passed to the callback function. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gabf38a498bd3527ea0b7cc947ae71e17e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> I2C_SlaveTransferGetCount </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i2c_slave_handle_t *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get slave transfer remaining bytes during a interrupt non-blocking transfer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer. </td></tr>
    <tr><td class="paramname">handle</td><td>pointer to i2c_slave_handle_t structure. </td></tr>
    <tr><td class="paramname">count</td><td>Number of bytes transferred so far by the non-blocking transaction. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_InvalidArgument</td><td>count is Invalid. </td></tr>
    <tr><td class="paramname">kStatus_Success</td><td>Successfully return the count. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga097c0b20503381de44cccba311dcf236"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void I2C_SlaveTransferHandleIRQ </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>i2cHandle</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Slave interrupt handler. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>I2C base pointer. </td></tr>
    <tr><td class="paramname">i2cHandle</td><td>pointer to i2c_slave_handle_t structure which stores the transfer state </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaa387d81ea08a9d4b39cfeb3dfec505f7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> I2C_SlaveTransferNonBlocking </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i2c_slave_handle_t *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>eventMask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Start accepting slave transfers. </p>
<p>Call this API after calling <a class="el" href="group__i2c.html#gae6e155a5aadb43d527418e2965e39123" title="Initialize the I2C peripheral, call this API to ungate the i2c clock and initializes the I2C with sla...">I2C_SlaveInit()</a> and <a class="el" href="group__i2c.html#gac9b90f575d92ff8ad3cc350a5c8ad1b9" title="Init the I2C handle which is used in transcational functions. ">I2C_SlaveTransferCreateHandle()</a> to start processing transactions driven by an I2C master. The slave will monitor the I2C bus and pass events to the callback that was passed into the call to <a class="el" href="group__i2c.html#gac9b90f575d92ff8ad3cc350a5c8ad1b9" title="Init the I2C handle which is used in transcational functions. ">I2C_SlaveTransferCreateHandle()</a>. The callback is always invoked from the interrupt context.</p>
<p>The set of events received by the callback is customizable. To do so, set the <em>eventMask</em> parameter to the OR'd combination of <a class="el" href="group__i2c.html#gac53e5c96a2eed1b5a95b7d84be48f4ac" title="Set of events sent to the callback for nonblocking slave transfers. ">i2c_slave_transfer_event_t</a> enumerators for the events you wish to receive. The <a class="el" href="group__i2c.html#ggac53e5c96a2eed1b5a95b7d84be48f4aca2f85039a57379838909876a1d509b7aa">kI2C_SlaveTransmitEvent</a> and <a class="el" href="group__lpi2c__slave__driver.html#gga0d99b4dba3841a4e02f7c431a59006c8ac737ba9e4e62880a6e2d8aac98ae8f18">kLPI2C_SlaveReceiveEvent</a> events are always enabled and do not need to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and receive events that are always enabled. In addition, the <a class="el" href="group__i2c.html#ggac53e5c96a2eed1b5a95b7d84be48f4aca94b030ebdac378a84961893ae567bfbc">kI2C_SlaveAllEvents</a> constant is provided as a convenient way to enable all events.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The I2C peripheral base address. </td></tr>
    <tr><td class="paramname">handle</td><td>Pointer to #i2c_slave_handle_t structure which stores the transfer state. </td></tr>
    <tr><td class="paramname">eventMask</td><td>Bit mask formed by OR'ing together <a class="el" href="group__i2c.html#gac53e5c96a2eed1b5a95b7d84be48f4ac" title="Set of events sent to the callback for nonblocking slave transfers. ">i2c_slave_transfer_event_t</a> enumerators to specify which events to send to the callback. Other accepted values are 0 to get a default set of only the transmit and receive events, and <a class="el" href="group__i2c.html#ggac53e5c96a2eed1b5a95b7d84be48f4aca94b030ebdac378a84961893ae567bfbc">kI2C_SlaveAllEvents</a> to enable all events.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">#kStatus_Success</td><td>Slave transfers were successfully started. </td></tr>
    <tr><td class="paramname"><a class="el" href="group__i2c.html#gga7cc91c89125c25a88e463a9e8550b284a49091894b590d7e479605bf113918952">kStatus_I2C_Busy</a></td><td>Slave transfers have already been started on this handle. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga280404c6b1ede542f2c1c20bd382869c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> I2C_SlaveWriteBlocking </td>
          <td>(</td>
          <td class="paramtype">I2C_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>txBuff</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>txSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Performs a polling send transaction on the I2C bus. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The I2C peripheral base pointer. </td></tr>
    <tr><td class="paramname">txBuff</td><td>The pointer to the data to be transferred. </td></tr>
    <tr><td class="paramname">txSize</td><td>The length in bytes of the data to be transferred. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td>Sucessully complete the data transmission. </td></tr>
    <tr><td class="paramname">kStatus_I2C_ArbitrationLost</td><td>Transfer error, arbitration lost. </td></tr>
    <tr><td class="paramname">kStataus_I2C_Nak</td><td>Transfer error, receive Nak during transfer. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Mar 7 2016 16:48:23 for Kinetis Bootloader by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
